//package com.itheima.reggie.interceptor;
//
//import com.alibaba.fastjson.JSON;
//import com.itheima.reggie.common.R;
//import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
//import org.springframework.stereotype.Component;
//
//import org.springframework.web.servlet.HandlerInterceptor;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
//@Component
//public class LoginCheckInterceptor implements HandlerInterceptor {
//public boolean preHandle(HttpServletRequest request, HttpServletResponse response) throws IOException {
//    Long empId = (Long) request.getSession().getAttribute("employee");
//    if (empId==null){
//        response.getWriter().write(JSON.toJSONString(R.error("NOTLOGIN")));
//        return false;
//    }
//    return true;
//}
//public void afterCompletion(HttpServletRequest request, HttpServletResponse response,Object handle,Exception ex){
//
//}
//}
